<?php

use yii\db\Migration;

/**
 * Handles the creation of table `share`.
 */
class m181012_101916_create_share_table extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->createTable('share', [
            'id' => $this->primaryKey(),
            'name' => $this->string(32)->notNull()->defaultValue('')->comment('姓名'),
            'start' => $this->integer(11)->notNull()->defaultValue(0)->comment('开跑时间'),
            'ban_result' => $this->string(32)->notNull()->defaultValue('')->comment('半马成绩'),
            'ban_num' => $this->integer(10)->notNull()->defaultValue(0)->comment('半马个数'),
            'q_result' => $this->string(32)->notNull()->defaultValue('')->comment('半马成绩'),
            'q_num' => $this->integer(10)->notNull()->defaultValue(0)->comment('半马个数'),
            'num' => $this->integer(10)->notNull()->defaultValue(0)->comment('城市数量'),
            'created_at' => $this->integer(11)->notNull()->defaultValue(0)->comment('添加时间')
        ]);
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropTable('share');
    }
}
